/*
 * Copyright (c) 2023-2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef DEVICE_NOTIFICATION_H
#define DEVICE_NOTIFICATION_H

#define API __attribute__((visibility("default")))

#include <mutex>
#include <string>

#include "image_source.h"
#include "pixel_map.h"
#include "event_config.h"

namespace OHOS {
namespace ExternalDeviceManager {

constexpr const char *PERIPHERAL_ICON_PATH = "system/etc/peripheral/resources/peripheral_fault_icon.png";

const int32_t NOTIFICATION_SERVICE_SYS_ABILITY_ID = 3085;
const int32_t AIVNSN_NOTIFICATION_CONTROL_FLAG = 1 << 9;

class DeviceNotification {
public:
    static DeviceNotification &GetInstance(void);

    void HandleNotification(FaultInfo &notifCfg);

private:
    DeviceNotification() = default;
    virtual ~DeviceNotification() = default;

    void PeripheralDeviceNotification(FaultInfo &notifCfg);
    FaultInfo FillNotificationotifCfg(const FaultInfo &notifCfg);
    void GetPixelMap(const std::string &path);

    std::shared_ptr<Media::PixelMap> iconPixelMap_ {};
};

extern "C" API void HandleNotification(FaultInfo &notifCfg);

} // namespace ExternalDeviceManager
} // namespace OHOS
#endif // DEVICE_NOTIFICATION_H